<?php
namespace app\admin\controller;


class Rules extends \app\common\controller\Base {
	protected $modelname='Rule';
	protected $_AllowRecache=true;

	public function _index(){
		//根据用户组进行选择
		$userInfo=$GLOBALS['userInfo'];
		$gids=$userInfo['gids'];

		if (!in_array(0,$gids)) {
			$groupModel=model("Group");
			$groupModel=new $groupModel();
			return [['id','in', $groupModel->getRulesList($userInfo['gidkeys'],$gids)]];
		}
	}
	protected function recache() {
		\think\facade\Cache::clear('AUTH_RULE_LIST');
		\think\facade\Cache::clear('GROUP_ACCESS');
		\think\facade\Cache::clear('ModelCache_Menu');
	}
}


?>